$(document).ready(function() {
	var remoteTrans = new Helper.RemoteTrans({
		url:Helper.basePath+"/memberCenter/updatePassword.htm",
		onError:function(json){
			Helper.message(json.message);
		},
		onSuccess:function(json) {
			if(json.code=="0000"){
				Helper.message("密码修改成功");
				location.href=Helper.basePath+"/page/login/login.jsp";
			}else{
				Helper.message("系统繁忙，请稍后重试");
			}
		}
	});
	//修改密码
	$("#settings-submit").click(function(){
		var old_password=$("#old_password").val();
		var password=$("#new_password").val();
		var re_new_password=$("#re_new_password").val();
		var validataPass=Helper.validata.validataPass(password);
		if(validataPass){
			Helper.message(validataPass);
			return ;
		}
		var validataPassword_re=Helper.validata.validataPass(re_new_password);
		if(validataPassword_re){
			Helper.message(validataPassword_re);
			return ;
		}
		if(password!=re_new_password){
			Helper.message("密码不一致");
			return;
		}
		remoteTrans.params = {oldPassword:old_password,password:password,re_new_password:re_new_password};
		remoteTrans.send();
	});
});